#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project : gtmsAutoTestProject 
@File    : user_api.py
@IDE     : PyCharm 
@Author  : Mario
@Date    : 2022/8/23 10:33 
@Describe: POS用户相关接口
"""
from APIs.posApi.base_pos_api import BasePosApi


class UserApi(BasePosApi):

    def __init__(self, brandCode, environment):
        super().__init__(brandCode, environment)
        self.brandCode = brandCode

    def pos_login(self):
        """
        pos端登录
        :return:
        """
        payload = '{"password":"' + self.password + '","shortNo":"' + self.shortNo + '","loginMac":"' + self.loginMac + '"}'
        response = self.http_requests('auth/login', payload)
        return response

    def pos_work(self):
        """
        POS员工上班
        :return:
        """
        payload = '{"backCash":"0","workShiftCode":"shift' + self.brandCode + '-01"}'
        response = self.http_requests('pos/work/towork', payload)
        return response


if __name__ == '__main__':
    test = UserApi("823882", "sit")
    test.pos_login()
